import threading
import time
# def coding():
#     for x in range(3):
#         print("%s 正在写代码" % x)
#         time.sleep(1)
# def drawing():
#     for x in range(3):
#         print("%s 正在画图" % x)
#         time.sleep(1)
# def main():
#     coding()
#     drawing()
# #以上花费了6秒

def coding():
    for x in range(3):
        print("%s 正在写代码" % threading.current_thread())
        time.sleep(1)
def drawing():
    for x in range(3):
        print("%s 正在画图" % threading.current_thread())
        time.sleep(1)
def main():
    t1 = threading.Thread(target=coding)
    t2 = threading.Thread(target=drawing)

    t1.start()
    t2.start()

    print(threading.enumerate()) #查看线程的数量


if __name__ == "__main__":
    main()